package com.example;

public class User {
    private String name;
    private String email;
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Override
    public boolean equals(Object obj) {
        // 潜在的空指针异常风险
        User other = (User) obj;
        return this.name.equals(other.name);  // 未检查null
    }
    
    @Override
    public String toString() {
        return name + " - " + email;  // 可能的空指针异常
    }
}
